function figure_windowbuttonmotionfcn_demo

  f = figure;
  ax = gca ();
  title ('Left-click to start drawing patch contour. Right-click to finish. Middle-click to cancel');
  axis ([0 1 0 1]);
  set (f, 'WindowButtonDownFcn', {@onButtonDown, ax});
  set (ax, 'UserData', []);

end



